package com.resource.provider.httpService;

import com.resource.provider.util.Https;
import net.sf.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 用户服务http调用
 *
 * @author wpin
 */
@Component
public class UserHttpService {

    private Logger logger = LoggerFactory.getLogger(getClass());

    /**
     * 根据token获取用户信息
     *
     * @param accessToken
     * @return
     */
    public JSONObject getUserByAccessToken(String accessToken) {
        // 封装 请求参数
        String param = "access_token=" + accessToken;
        JSONObject jsonObject = Https.sendGet("v1/wyy/company/user/query", param);
        logger.info("获取用户信息：{}", jsonObject.get("content").toString());
        return jsonObject;
    }


    public static void main(String[] args) {
        String ids = "";
        for(String id : ids.split(",")){
            String url = "id="+id;
            String message = Https.sendDelete(url);
            System.out.print(1);
        }

    }
}
